﻿Imports System.Data.SqlClient
Imports _1065144_1065164.DataProvider
Imports _1065144_1065164.ThongTinNhaDAO
Public Class ThongTinNhaBUS
    Public Shared Function GetAll() As DataTable
        Dim listThongTinNha As DataTable

        listThongTinNha = ThongTinNhaDAO.GetAll()

        Return listThongTinNha
    End Function

    Public Shared Function HienThiGidView() As DataTable
        Dim listThongTinNha As DataTable

        listThongTinNha = ThongTinNhaDAO.HienThiGidView()

        Return listThongTinNha
    End Function

    Public Shared Sub Insert(ByVal sqlparameters As SqlParameter())
        ThongTinNhaDAO.Insert(sqlparameters)
    End Sub
    Public Shared Sub Update(ByVal sqlparameters As SqlParameter())
        ThongTinNhaDAO.Update(sqlparameters)
    End Sub
    Public Shared Sub Delete(ByVal sqlparameters As SqlParameter)

        ThongTinNhaDAO.Delete(sqlparameters)

    End Sub



    Public Shared Function TKTheoMaNha(ByVal manha As Integer) As DataTable
        Dim paraMa As New SqlParameter("manha", SqlDbType.Int)
        paraMa.Direction = ParameterDirection.Input
        paraMa.Value = manha

        Dim listTimKiem As New DataTable
        listTimKiem = ThongTinNhaDAO.TKTheoMaNha(paraMa)

        Return listTimKiem
    End Function
    Public Shared Function TKTheoLoaiNha(ByVal maloainha As Integer) As DataTable
        Dim paraMa As New SqlParameter("MaLoaiNha", SqlDbType.Int)
        paraMa.Direction = ParameterDirection.Input
        paraMa.Value = maloainha

        Dim listTimKiem As New DataTable
        listTimKiem = ThongTinNhaDAO.TKTheoLoaiNha(paraMa)

        Return listTimKiem
    End Function
End Class
